<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>主页</title>
<%@include file="WEB-INF/include/includecss.jsp"%>
</head>
<body>
	<%@include file="WEB-INF/include/includemenu.jsp"%>

	<div class="container theme-showcase container-fixed-top" role="main">

		<h1 class="pull-left">
			<img src="pic/logo.png" width=100px height=100px />六只蚊子书评
		</h1>

<%@include file="WEB-INF/include/includesearch.jsp"%>

		<div class="col-sm-8">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">
						新书速递<small>&nbsp;</small>
					</h3>
				</div>
				<div class="panel-body">
					<div id="myCarousel" class="carousel slide">
						<!-- 轮播（Carousel）项目 -->
						<div class="carousel-inner">

							<c:forEach var="itemCount" begin="0" end="2" step="1">
								<div class="item ${(itemCount==0)?"active":"" }">
									<c:forEach var="rowCount" begin="0" end="1" step="1">
										<div class="row">
											<div class="col-sm-1"></div>
											<c:forEach var="bookIndex"
												begin="${(itemCount*10)+(rowCount*5) }"
												end="${(itemCount*10)+(rowCount*5)+4 }" step="1">
												<div class="col-sm-2">
													<a href="${pageContext.request.contextPath}/BookServlet?bookID=${newBookList[bookIndex].bookInfoBean.bookID}"><img
														src="${pageContext.request.contextPath}/pic/${newBookList[bookIndex].bookInfoBean.bookID }.jpg"
														width="106px" height="158px"
														alt="${newBookList[bookIndex].bookInfoBean.bookName}" />
													</a> <a href="${pageContext.request.contextPath}/BookServlet?bookID=${newBookList[bookIndex].bookInfoBean.bookID}">${newBookList[bookIndex].bookInfoBean.bookName}</a><br>
												
													作者${newBookList[bookIndex].bookInfoBean.bookName}
													<!-- 
													<a
														href="${pageContext.request.contextPath}/BookServlet?bookID=${newBookList[bookIndex].bookInfoBean.bookID}"></a> -->
												</div>
											</c:forEach>
											<div class="col-sm-1"></div>
										</div>
										<!-- end row-->
									</c:forEach>
								</div>
							</c:forEach>
						</div>
						<!-- End carousel-inner -->

						<!-- 轮播（Carousel）导航 -->
						<a class="carousel-control left" href="#myCarousel"
							data-slide="prev">&lsaquo;</a> <a class="carousel-control right"
							href="#myCarousel" data-slide="next">&rsaquo;</a>
					</div>
				</div>
			</div>
			<!-- end panel -->
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">
						热门书籍<small>&nbsp;</small>
					</h3>
				</div>
				<div class="panel-body">
					<c:forEach var="itemCount" begin="0" end="4" step="1">
						<div class="row">
							<div class="col-sm-1"></div>
							<c:forEach var="rowCount" begin="${(itemCount*5)}"
								end="${(itemCount*5)+4}" step="1">
								<div class="col-sm-2">
									<a href="${pageContext.request.contextPath}/BookServlet?bookID=${topBookList[rowCount].bookInfoBean.bookID}"> <img
										src="${pageContext.request.contextPath}/pic/${topBookList[rowCount].bookInfoBean.bookID }.jpg" width="106px" height="158px"
										 />
									</a> <a href="${pageContext.request.contextPath}/BookServlet?bookID=${topBookList[rowCount].bookInfoBean.bookID}">${topBookList[rowCount].bookInfoBean.bookName}</a><br>作者<a
										href="${pageContext.request.contextPath}/BookServlet?bookID=${topBookList[rowCount].bookInfoBean.bookID}">${topBookList[rowCount].bookDetialBean.bookAuthor}</a>
								</div>
							</c:forEach>

						</div>
					</c:forEach>
				</div>
			</div>
		</div>
		<!-- /.col-sm-4 -->

		<div class="col-sm-4">
			<!-- <div class="panel panel-warning">
				<div class="panel-heading">
					<h3 class="panel-title">热门标签</h3>
				</div>
				<div class="panel-body">
					<div class="row">
						文学
						<c:forEach begin="0" end="6" step="1" var="itemCount">
							
							<span class="label label-danger"> <a href="${pageContext.request.contextPath}/${managerHotBookLabel[itemCount].bookId }">${managerHotBookLabel[itemCount].bookId }</a></span>
						</c:forEach>
						<hr style="width: 100px; margin-top: 10px; margin-bottom: 10px">
					</div>
				</div>
			</div> -->
			<div class="panel panel-danger">
				<div class="panel-heading">
					<h3 class="panel-title">用户中心</h3>
				</div>
				<div class="panel-body">
					<c:if test="${user==null}">
						<form class="form-inline"
							action="${pageContext.request.contextPath}/UserLoginServlet"
							method="post">
							<div class="form-group">
								<label for="exampleInputName2">Name</label> <input type="text"
									class="form-control" id="exampleInputName2" name="form_name"
									placeholder="Jane Doe">
							</div>
							<div class="form-group">
								<label for="exampleInputPassword1">Password</label> <input
									type="password" class="form-control" id="exampleInputPassword1"
									placeholder="Password" name="form_password">
							</div>
							<div class="checkbox">
							<label><a href="regedit.jsp">注册新用户</a></label>
								<!-- <label> <input type="checkbox"> Remember me
								</label>-->
							</div>
							<button type="submit" class="btn btn-default">登录</button>
							<label>${ErrPwdException}</label>
						</form>


					</c:if>
					<c:if test="${user!=null}">

						<div class="row">
							<div class="col-sm-12">
								<span>${user.userName }欢迎您 &nbsp;<a href="${pageContext.request.contextPath }/UserCenterServlet">进入个人中心</a> &nbsp;<a
									href="${pageContext.request.contextPath }/UserLoginExitServlet">注销登录</a></span>
							</div>
						</div>
					</c:if>
				</div>
			</div>
		</div>
		<!-- /.col-sm-4 -->

	</div>

	<%@ include file="WEB-INF/include/bottom.jsp"%>
</body>
</html>